package A010map;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public class D002_Map不安全例子HashMap {

    public static void main(String[] args) {
        Map<String,String> map = new HashMap<>();

        for (int i = 0; i <30; i++) {
            String key = String.valueOf(i);
            new Thread(()->{
                //向集合添加内容
                map.put(key, UUID.randomUUID().toString().substring(0,8));
                //从集合获取内容
                System.out.println(map);
            },String.valueOf(i)).start();
        }

    }
}

